package com.example.yskjproject.model;

import android.os.Parcel;
import android.os.Parcelable;

public class RechargeRecordModel implements Parcelable {
    private int id;
    private String name;
    private int type;
    private int price;
    private int value;
    private int gift;
    private String mark;
    private int status;
    private int sort;

    // 构造函数
    public RechargeRecordModel(int id, String name, int type, int price, int value, int gift, String mark, int status, int sort) {
        this.id = id;
        this.name = name;
        this.type = type;
        this.price = price;
        this.value = value;
        this.gift = gift;
        this.mark = mark;
        this.status = status;
        this.sort = sort;
    }

    // Parcelable 构造函数
    protected RechargeRecordModel(Parcel in) {
        id = in.readInt();
        name = in.readString();
        type = in.readInt();
        price = in.readInt();
        value = in.readInt();
        gift = in.readInt();
        mark = in.readString();
        status = in.readInt();
        sort = in.readInt();
    }

    // writeToParcel 方法
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(name);
        dest.writeInt(type);
        dest.writeInt(price);
        dest.writeInt(value);
        dest.writeInt(gift);
        dest.writeString(mark);
        dest.writeInt(status);
        dest.writeInt(sort);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<RechargeRecordListModel> CREATOR = new Creator<RechargeRecordListModel>() {
        @Override
        public RechargeRecordListModel createFromParcel(Parcel in) {
            return new RechargeRecordListModel(in);
        }

        @Override
        public RechargeRecordListModel[] newArray(int size) {
            return new RechargeRecordListModel[size];
        }
    };

    // Getter 和 Setter 方法
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public int getType() { return type; }
    public void setType(int type) { this.type = type; }

    public int getPrice() { return price; }
    public void setPrice(int price) { this.price = price; }

    public int getValue() { return value; }
    public void setValue(int value) { this.value = value; }

    public int getGift() { return gift; }
    public void setGift(int gift) { this.gift = gift; }

    public String getMark() { return mark; }
    public void setMark(String mark) { this.mark = mark; }

    public int getStatus() { return status; }
    public void setStatus(int status) { this.status = status; }

    public int getSort() { return sort; }
    public void setSort(int sort) { this.sort = sort; }
}
